macsec: dynamically allocate space for sglist
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 25 Apr 2017 17:08:18 +0000 (19:08 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 2 May 2017 15:21:44 +0000 (15:21 +0000)
commit8cdf7e6dc570d799b5fd762210580f4df0484d58
tree1dc5d508e09a0b66ab9f89d2e735d8cfeaef7701
parent1b2dfbca85576dd1cddca7cb413b5f8054b0afd6
macsec: dynamically allocate space for sglist

We call skb_cow_data, which is good anyway to ensure we can actually
modify the skb as such (another error from prior). Now that we have the
number of fragments required, we can safely allocate exactly that amount
of memory.

Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Acked-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name macsec-dynamically-allocate-space-for-sglist.patch
drivers/net/macsec.c